import { lazy } from 'react'
/* -------------------------------------------------------- Declare -- */
const { $lazy } = window
/* -------------------------------------------------------- Async Component -- */
const SubmitForm = $lazy.hook(()=>import('#cpt/form/submit-form'))
const Page = lazy(()=>import('#tp/content/page-content'))
/* -------------------------------------------------------- Page Component -- */
const Component = ({ api='user/mod_pwd' }) => {
	const pageConfig = {
		title: '修改密码',
	}
	// const { username } = $fn.getUser()
	const config = {
		labelWidth: 's7',
		api,
		way: 'put',
		paddingClass: 'pt10 pr10',
		data:[
			{ label: '原密码',	name: 'old_pwd', 	type:'password', r:1, half:1, br:1 },
			{ label: '新密码',	name: 'password', 		type:'password', r:1, half:1, br:1},
			{ label: '确认密码',	name: 'confirm_pwd', 	type:'password', r:1, half:1, br:1},
		],
		onOk: ({ formRef }) => formRef.reset()
	}
	return (
		<Page {...pageConfig}>
			<SubmitForm {...config}/>
		</Page>
	)
}
export default Component